package com.study.boot.event.listener;

import com.study.boot.event.NotifyEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author fangdengfu
 * @date 2020/7/4 9:40
 */
@Component
@Slf4j
public class NotifyListener implements ApplicationListener<NotifyEvent> {

    @Override
    @Async
    public void onApplicationEvent(NotifyEvent notifyEvent) {
        log.info("收到事件： {}", notifyEvent.getMsg());
    }
}
